package st.business.tepth.business.user.busnumber.workholder.repair.work.content;

import java.util.List;

import io.reactivex.disposables.Disposable;
import st.business.tepth.base.OnDataConvertListener;
import st.business.tepth.business.bean.DiagnoseBean;
import st.business.tepth.business.bean.PartLocationBean;
import st.business.tepth.business.bean.PickGoodsWrapper;
import st.business.tepth.business.bean.PostDiagnoseWrapperBean;
import st.business.tepth.business.bean.RepairTaskBean;
import st.business.tepth.business.bean.RepairTaskTypeBean;
import st.shadow.library.core.base.mvp.BaseModel;
import st.shadow.library.core.base.mvp.BasePresenter;
import st.shadow.library.core.base.mvp.BaseView;

/**
 * @author zhangyu
 * @date 2019/2/13
 */
public interface RepairContract {
    interface View extends BaseView {
        void postDiagnoseList(List<DiagnoseBean> list);

        void showRepairTask(RepairTaskBean repairTaskBean);

        void showError(String msg);

        void deleteDiagnoseSucceed();

        void deleteProgramSucceed(int position);

        void showPickGoods(PickGoodsWrapper pickGoodsWrapper);

        void submitFinishSucceed();

        void finishSucceed();

        void pickGoodsSucceed();

        void returnGoodsSucceed(int position);

        void troubleHadDelete(String str);

        void addCoWorkerSucceed(int position);

        void cancelCoWorkerSucceed(int position);

        void cancelFinishWorkSucceed();

        void showTempLocation(PartLocationBean partLocationBean, int position);
    }

    interface Model extends BaseModel {
        Disposable getWorkData(String token, int repairId, int vehicleSeriesId,
                               OnDataConvertListener<RepairTaskTypeBean> listener);

        Disposable postDiagnoseList(String token, int repairId,
                                    int repairTaskId,
                                    int vehicleSeriesId,
                                    String faultDiagnosticList,
                                    OnDataConvertListener<PostDiagnoseWrapperBean>
                                            success);

        Disposable postProgram(final String token, final int repairId,
                               final int repairTaskId,
                               final int vehicleSeriesId, String taskItemList,
                               OnDataConvertListener<PickGoodsWrapper> pickListener,
                               OnDataConvertListener<RepairTaskTypeBean>
                                       success);

        Disposable deleteDiagnose(String token, int repairId, int vehicleSeriesId,
                                  int faultDiagnosticId,
                                  int faultDiagnosticIdType,
                                  OnDataConvertListener<String> deleteListener,
                                  OnDataConvertListener<RepairTaskTypeBean>
                                          listener);

        Disposable deleteProgram(String token, int repairId,
                                 int faultDiagnosticId, int planId,
                                 OnDataConvertListener<String>
                                         listener);

        Disposable submitFinishWork(String token, int repairId,
                                    int repairTaskId,
                                    int vehicleSeriesId,
                                    OnDataConvertListener<RepairTaskTypeBean>
                                            dataListener,
                                    OnDataConvertListener<String>
                                            statusListener);

        Disposable pickGoods(String token, int repairId,
                             int vehicleSeriesId, String materialApplyList,
                             OnDataConvertListener<String> pickListener,
                             OnDataConvertListener<RepairTaskTypeBean> listener);

        Disposable returnGoods(String token, String items, int planId,
                               OnDataConvertListener<String> returnListener);

        Disposable addCoWorker(String token, int id, OnDataConvertListener<String> listener);

        Disposable cancelCoWorker(String token, int id, OnDataConvertListener<String> listener);

        Disposable cancelFinishWork(String token, int repairId, int repairTaskId,
                                    int vehicleSeriesId,
                                    OnDataConvertListener<String> cancelListener,
                                    OnDataConvertListener<RepairTaskTypeBean> dataListener);

        Disposable addTempLocation(String token,
                                   String tempLocation,
                                   OnDataConvertListener<List<PartLocationBean>> listener);
    }

    abstract class Presenter extends BasePresenter<View> {
        abstract void getWorkData(String token, int repairId, int vehicleSeriesId);


        abstract void confirmDiagnoseList(String token, int repairId,
                                          int repairTaskId,
                                          int vehicleSeriesId,
                                          String faultDiagnosticList);

        abstract void confirmProgram(final String token, final int repairId,
                                     final int repairTaskId,
                                     final int vehicleSeriesId, String taskItemList);

        abstract void deleteDiagnose(String token, int repairId,
                                     int vehicleSeriesId,
                                     int faultDiagnosticId,
                                     int faultDiagnosticIdType);

        abstract void deleteProgram(String token, int repairId,
                                    int faultDiagnosticId, int planId,
                                    int position);

        abstract void submitFinishWork(String token, int repairId, int repairTaskId,
                                       int vehicleSeriesId);

        abstract void pickGoods(String token, int repairId,
                                int vehicleSeriesId, String materialApplyList);

        abstract void returnGoods(String token, String items, int planId,
                                  int position);

        abstract void addCoWorker(String token, int id,
                                  int position);

        abstract void cancelCoWorker(String token, int id,
                                     int position);

        abstract void cancelFinishWork(String token, int repairId, int repairTaskId,
                                       int vehicleSeriesId);

        abstract void addTempLocation(String token, int position,
                                      PartLocationBean partLocationBean,
                                      String tempLocation);
    }
}
